package club.caihappy.service;

import club.caihappy.dao.BookMapper;
import club.caihappy.dao.BookService;
import club.caihappy.pojo.Books;

import java.util.List;

/**
 * Created by 百岁 on 2021/9/14
 **/
public class BookServiceImpl implements BookService {
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int addBook(Books book) {
        return bookMapper.addBook(book);
    }

    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    public int updateBook(Books book) {
        return bookMapper.updateBook(book);
    }

    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    public List<Books> queryAllBooks() {
        return bookMapper.queryAllBooks();
    }

    public Books queryByName(String bookName) {
        return bookMapper.queryByName(bookName);
    }
}
